//    Openbravo POS is a point of sales application designed for touch screens.
//    Copyright (C) 2007-2008 Openbravo, S.L.
//    http://sourceforge.net/projects/openbravopos
//
//    This program is free software; you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation; either version 2 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program; if not, write to the Free Software
//    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

report = new com.openbravo.pos.reports.PanelReportBean();

report.setTitleKey("Menu.ReportTaxes");
report.setReport("/com/openbravo/reports/taxes");
report.setResourceBundle("com/openbravo/reports/taxes_messages");

report.setSentence(
                "SELECT TAXCATEGORIES.ID AS TAXID, TAXCATEGORIES.NAME AS TAXNAME, SUM(TAXLINES.AMOUNT) AS TOTALTAXES " +
                "FROM RECEIPTS, TAXLINES, TAXES, TAXCATEGORIES " + 
                "WHERE RECEIPTS.ID = TAXLINES.RECEIPT AND TAXLINES.TAXID = TAXES.ID AND TAXES.CATEGORY = TAXCATEGORIES.ID " +
                "AND ?(QBF_FILTER) " +
                "GROUP BY TAXCATEGORIES.ID,  TAXCATEGORIES.NAME");
report.addParameter("RECEIPTS.DATENEW");
report.addParameter("RECEIPTS.DATENEW");
report.addQBFFilter(new com.openbravo.pos.reports.JParamsDatesInterval());

report.addField("TAXID", com.openbravo.data.loader.Datas.STRING);
report.addField("TAXNAME", com.openbravo.data.loader.Datas.STRING);
report.addField("TOTALTAXES", com.openbravo.data.loader.Datas.DOUBLE);

report;
